package com.gdyx.app.web.filter;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class ServletContextConfig  extends WebMvcConfigurerAdapter {

    @Bean
    public MpsInterceptor getMpsInterceptor() {
        return new MpsInterceptor();
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        InterceptorRegistration it = registry.addInterceptor(getMpsInterceptor());
        it.addPathPatterns("/**");
        it.excludePathPatterns("/MpsOrg/ApplyOrg/**");
        super.addInterceptors(registry);
    }
}
